package com.vue.cn.exception;

import com.vue.cn.common.http.AjaxResult;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class MyExceptionHandler {

    @ExceptionHandler(MyException.class)
    public AjaxResult exceptionHandle(MyException exception){
        System.out.println("异常处理，返回没有登陆");
        return AjaxResult.error(exception.getStatusEnum());

    }
}
